package com.mf.springcloud.service.impl;

import com.mf.springcloud.dao.ArticleDao;
import com.mf.springcloud.entity.Article;
import com.mf.springcloud.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    private ArticleDao articleDao;

    @Override
    public boolean addArticle(Article article) {
        return articleDao.addArticle(article);
    }

    @Override
    public Article get(Long id) {
        return articleDao.findById(id);
    }

    @Override
    public List<Article> list() {
        return articleDao.findAll();
    }
}
